import request from '@/utils/request'
import qs from 'qs'

export function login(loginuser) {
    return request({
        url: '/ids/pub/login',
        method: 'post',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',

        },
        data: loginuser
    })
}

// 微信登录，根据code获取用户细腻
export function pcLoginByWx(params) {
    return request({
        url: '/ids/pub/pcLoginByWx',
        method: 'get',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',

        },
        params: params
    })
}

// export function login(loginuser) {
//   return request({
//     url: '/operate/login',
//     method: 'post',
//     headers: {
//       'Content-Type': 'application/x-www-form-urlencoded',
//       // 'platform-type':'OPERATE'
//     },
//     data: qs.stringify(loginuser)
//   })
// }

export function getInfo() {
    return request({
        url: '/ids/user/current',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: 'get'
    })
}